Skip to content

[v3-2-test] CI: Notify open PRs that conflict on uv.lock after main merges (#65765)#65851

Merged
potiuk merged 1 commit into
v3-2-testfrom
backport-4fae29c-v3-2-test
Apr 26, 2026
Merged

[v3-2-test] CI: Notify open PRs that conflict on uv.lock after main merges (#65765)#65851
potiuk merged 1 commit into
v3-2-testfrom
backport-4fae29c-v3-2-test

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

  • CI: Notify open PRs that conflict on uv.lock after main merges

When uv.lock changes on main, open PRs that touch uv.lock frequently
end up with rebase conflicts. This adds a workflow that, on each push to
main that modifies uv.lock, scans open non-draft PRs (updated in the
last 14 days), identifies those currently reporting conflicts, and posts
(or updates, deduped via an HTML-comment marker) a single comment with
rebase-and-uv lock instructions.

The source PR that caused the change is resolved from the squash-merge
commit headline's trailing (#NNN) and linked in the notice.

Implemented as a standalone PEP 723 Python script (httpx + GitHub's
GraphQL API) so logic stays testable; workflow YAML is a thin driver that
installs uv from uv.lock and runs the script. Unit tests cover the
regex, classifier, pagination/early-exit, UNKNOWN-mergeable retry loop,
and notice posting.

  • Fix scripts-tests by stubbing httpx in unit-test module

The scripts-project CI venv doesn't have httpx installed, so importing
notify_uv_lock_conflicts fails with ModuleNotFoundError: No module named 'httpx' before any test runs. httpx is a PEP 723 runtime dep of
the script; the tests mock the client and never need the real library.

Stub httpx in sys.modules with setdefault before loading the
module under test: keeps the scripts distribution's declared deps
unchanged, and leaves real httpx alone when present (e.g. in the
workspace-wide dev environment).
(cherry picked from commit 4fae29c)

Co-authored-by: Jarek Potiuk jarek@potiuk.com

…erges (#65765)

* CI: Notify open PRs that conflict on uv.lock after main merges

When `uv.lock` changes on `main`, open PRs that touch `uv.lock` frequently
end up with rebase conflicts. This adds a workflow that, on each push to
`main` that modifies `uv.lock`, scans open non-draft PRs (updated in the
last 14 days), identifies those currently reporting conflicts, and posts
(or updates, deduped via an HTML-comment marker) a single comment with
rebase-and-`uv lock` instructions.

The source PR that caused the change is resolved from the squash-merge
commit headline's trailing `(#NNN)` and linked in the notice.

Implemented as a standalone PEP 723 Python script (`httpx` + GitHub's
GraphQL API) so logic stays testable; workflow YAML is a thin driver that
installs `uv` from `uv.lock` and runs the script. Unit tests cover the
regex, classifier, pagination/early-exit, UNKNOWN-mergeable retry loop,
and notice posting.

* Fix scripts-tests by stubbing httpx in unit-test module

The scripts-project CI venv doesn't have httpx installed, so importing
``notify_uv_lock_conflicts`` fails with ``ModuleNotFoundError: No module
named 'httpx'`` before any test runs. httpx is a PEP 723 runtime dep of
the script; the tests mock the client and never need the real library.

Stub ``httpx`` in ``sys.modules`` with ``setdefault`` before loading the
module under test: keeps the scripts distribution's declared deps
unchanged, and leaves real ``httpx`` alone when present (e.g. in the
workspace-wide dev environment).
(cherry picked from commit 4fae29c)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
@potiuk potiuk force-pushed the backport-4fae29c-v3-2-test branch from 481c2bf to abf7272 Compare April 26, 2026 16:59
@potiuk potiuk merged commit 7eec05a into v3-2-test Apr 26, 2026
111 checks passed
@potiuk potiuk deleted the backport-4fae29c-v3-2-test branch April 26, 2026 19:45
vatsrahul1001 pushed a commit that referenced this pull request Apr 27, 2026
…erges (#65765) (#65851)

* CI: Notify open PRs that conflict on uv.lock after main merges

When `uv.lock` changes on `main`, open PRs that touch `uv.lock` frequently
end up with rebase conflicts. This adds a workflow that, on each push to
`main` that modifies `uv.lock`, scans open non-draft PRs (updated in the
last 14 days), identifies those currently reporting conflicts, and posts
(or updates, deduped via an HTML-comment marker) a single comment with
rebase-and-`uv lock` instructions.

The source PR that caused the change is resolved from the squash-merge
commit headline's trailing `(#NNN)` and linked in the notice.

Implemented as a standalone PEP 723 Python script (`httpx` + GitHub's
GraphQL API) so logic stays testable; workflow YAML is a thin driver that
installs `uv` from `uv.lock` and runs the script. Unit tests cover the
regex, classifier, pagination/early-exit, UNKNOWN-mergeable retry loop,
and notice posting.

* Fix scripts-tests by stubbing httpx in unit-test module

The scripts-project CI venv doesn't have httpx installed, so importing
``notify_uv_lock_conflicts`` fails with ``ModuleNotFoundError: No module
named 'httpx'`` before any test runs. httpx is a PEP 723 runtime dep of
the script; the tests mock the client and never need the real library.

Stub ``httpx`` in ``sys.modules`` with ``setdefault`` before loading the
module under test: keeps the scripts distribution's declared deps
unchanged, and leaves real ``httpx`` alone when present (e.g. in the
workspace-wide dev environment).
(cherry picked from commit 4fae29c)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
@vatsrahul1001 vatsrahul1001 added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label May 18, 2026
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.2.2 milestone May 18, 2026
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
…erges (#65765) (#65851)

* CI: Notify open PRs that conflict on uv.lock after main merges

When `uv.lock` changes on `main`, open PRs that touch `uv.lock` frequently
end up with rebase conflicts. This adds a workflow that, on each push to
`main` that modifies `uv.lock`, scans open non-draft PRs (updated in the
last 14 days), identifies those currently reporting conflicts, and posts
(or updates, deduped via an HTML-comment marker) a single comment with
rebase-and-`uv lock` instructions.

The source PR that caused the change is resolved from the squash-merge
commit headline's trailing `(#NNN)` and linked in the notice.

Implemented as a standalone PEP 723 Python script (`httpx` + GitHub's
GraphQL API) so logic stays testable; workflow YAML is a thin driver that
installs `uv` from `uv.lock` and runs the script. Unit tests cover the
regex, classifier, pagination/early-exit, UNKNOWN-mergeable retry loop,
and notice posting.

* Fix scripts-tests by stubbing httpx in unit-test module

The scripts-project CI venv doesn't have httpx installed, so importing
``notify_uv_lock_conflicts`` fails with ``ModuleNotFoundError: No module
named 'httpx'`` before any test runs. httpx is a PEP 723 runtime dep of
the script; the tests mock the client and never need the real library.

Stub ``httpx`` in ``sys.modules`` with ``setdefault`` before loading the
module under test: keeps the scripts distribution's declared deps
unchanged, and leaves real ``httpx`` alone when present (e.g. in the
workspace-wide dev environment).
(cherry picked from commit 4fae29c)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants